/*首页专用*/ $(function () { var slides = $('#hmslides .slick-load'); var status = 0; var myfullpage = $('#fullpage').fullpage({ anchors: ['slides', 'about', 'sp','service', 'video', 'news'], menu: '#sectionmenu', navigation: true, navigationposition: 'left', navigationtooltips: ['首页', '走进正方', '视频','正方业务', '正方视频', '新闻中心'], lockanchors: true, resize: true, verticalcentered: true, css3: true, controlarrows: false, loophorizontal: true, slidesnavigation: false, scrolloverflow: false, iswindowfocused: false, fixedelements: '#header', responsiveheight: 450, // responsivewidth: 1280, slidesnavigation: true, // paddingtop:'1.5em', // easingcss3: 'ease', // scrollingspeed: '700', onleave: function (origin, destination, direction) { if (destination == 2 && status == '0') { var data = $('#hmabout .count').countup({ useeasing: true, usegrouping: true, }); //status = 1; } if (destination > 1) { $('#header').addclass('show'); } else { $('#header').removeclass('show'); } }, afterload: function (origin, destination, direction) { }, afterrender: function () { slides.find('.item').height($(window).height()); slides.slick({ autoplay: true, autoplayspeed: 5000, speed: 1000, dots: true, arrows: false, vertical: false, slidestoshow: 1, slidestoscroll: 1, pauseonhover: false, }); }, afterresize: function (width, height) { slides.find('.item').height($(window).height()); }, afterrebuild: function () {}, afterresponsive: function (isresponsive) {}, afterslideload: function (section, origin, destination, direction) {}, onslideleave: function (section, origin, destination, direction) {} }); /**/ var hmnewsslick = $('#hmnews .slick-load').slick({ autoplay: true, autoplayspeed: 3000, speed: 500, dots: false, arrows: true, prevarrow: '', // 自定义左按钮的 html nextarrow: '', // 自定义右按钮的 html vertical: false, slidestoshow: 3, slidestoscroll: 1, pauseonhover: false, responsive: [ { breakpoint: 769, settings: { autoplay: true, slidestoshow: 1, dots: true, } } ] }); /**/ //hmnewsslick.slickplay(); //var test1 = window.setinterval(hmnewsslick.slickplay(),3000); //去掉定时器的方法 //window.clearinterval(test1); $('.itemmenu li').click(function () { $(this).addclass('cur').siblings().removeclass('cur'); var _index = $(this).index(); $('#hmservice .item').eq(_index).stop().fadein('fast').siblings().hide(); //$('#hmservice .bg').eq(_index).stop().show().siblings().hide(); }); //$('.itemmenu li').eq(0).trigger('click'); }); hmservice(".hmservice"); function hmservice(v) { //添加满屏高度 $(function ($) { $(window).on("resize", function (e) { wh(); colorbg(v); }).trigger("resize"); }); function wh() { var h = $(window).height(); $(v).height(h) } //背景图切换 var hover = $(v).find(".hover_slider li") //移动端背景色 function colorbg(v) { var li = $(v).find(".mouse").find("li") li.removeattr("style"); //开启背景图切换 li.click(function () { var e = $(this).index() hover.eq(e).addclass("show").siblings().removeclass("show"); var color = $(this).attr("data-color"); $(this).css("background-color", color).addclass("opacity"); }); } }